package com.dubboservice.demos.service.impl;






import com.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.curator.utils.ThreadUtils;
import org.apache.dubbo.config.annotation.DubboService;
import org.example.pojo.User;


/**
 * Created by Lenovo
 * DATA:2024/8/25
 **/
@Slf4j
@DubboService // 将这个类提供的方法（服务）对外发布。将访问的地址 ip ，端口 ，路径注册到注册中心去
public class UserServiceImpl implements UserService {//注意这里的userService必须要是Dubbo Interface中公共定义的接口
    @Override
    public String sayHello() {
        try {
            Thread.sleep(500);
        } catch (InterruptedException e) {
            log.info("出错了！！！");
            throw new RuntimeException(e);
        }
        return "hello";
    }

    @Override
    public User findByUser(int id) {
        User user = new User(id, "张三", "123456");
        return user;
    }
}
